package proj.pt.web;

import java.util.HashMap;
import java.util.Map;

import proj.pt.model.Course;
import proj.pt.model.Department;
import proj.pt.model.SubCourse;
import proj.pt.services.Role;

public class UserFilter {

	public static final String USER_ADMIN = "USER_ADMIN";
	public static final String USER_STAFF = "USER_STAFF";
	public static final String USER_STUDENT = "USER_STUDENT";
	
	private String userType;
	private String role;
	
	private Department department;
	
	private Course course;
	private SubCourse subCourse;
	private String batch;
	public String getRole() {
		return role;
	}
	public void setRole(String role) {
		this.role = role;
	}
	public Department getDepartment() {
		return department;
	}
	public void setDepartment(Department department) {
		this.department = department;
	}
	public Course getCourse() {
		return course;
	}
	public void setCourse(Course course) {
		this.course = course;
	}
	public SubCourse getSubCourse() {
		return subCourse;
	}
	public void setSubCourse(SubCourse subCourse) {
		this.subCourse = subCourse;
	}
	public String getBatch() {
		return batch;
	}
	public void setBatch(String batch) {
		this.batch = batch;
	}
	public String getUserType() {
		return userType;
	}
	public void setUserType(String userType) {
		this.userType = userType;
	}
	
	public Map getUserTypes(){
		Map map = new HashMap();
		map.put(USER_ADMIN, "Admin");
		map.put(USER_STAFF, "Staff");
		map.put(USER_STUDENT, "Student");
		return map;
	}
	
	public Map getRolesByUserType(){
		if(USER_ADMIN.equals(userType)){
			return Role.getAdminRoles();
		} else if(USER_STAFF.equals(userType)){
			return Role.getStaffRoles();
		} else if(USER_STUDENT.equals(userType)){
			return Role.getStudentRoles();
		}
		return null;
	}
	
}
